package com.sf.fy.uav.rest;

import com.sf.fy.uav.entity.InvitationCode;
import com.sf.fy.uav.service.IInvitationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 邀请码记录表 前端控制器
 * </p>
 *
 * @author LTQ
 * @since 2023-08-22
 */
@RestController
public class InvitationCodeRest {
    @Autowired
    private IInvitationCodeService iInvitationCodeService;

    @GetMapping("get-by-user-id")
    public InvitationCode getByUserId(@RequestParam Integer type, @RequestParam String userId) {
        return iInvitationCodeService.getByUserId(type, userId);
    }

    @GetMapping("get-by-invitation-code")
    public InvitationCode getByInvitationCode(@RequestParam String invitationCode) {
        return iInvitationCodeService.getByInvitationCode(invitationCode);
    }
}
